//////////////////////////////////////////////////////////////////////////////
//
//  Created by Philip Mulcahy on 30/01/2012.
//  Copyright (c) 2012 Philip Mulcahy. All rights reserved.
//
//  This file is part of the note-recog library.
//
//  note-recog is free software: you can redistribute it and/or modify
//  it under the terms of version 3 of the GNU Lesser General Public License 
//  as published by the Free Software Foundation.
//
//  note-recog is distributed is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with note-recog.  If not, see <http://www.gnu.org/licenses/>.
//
//////////////////////////////////////////////////////////////////////////////

#ifndef note_recog_RecogImpl_h
#define note_recog_RecogImpl_h

#include "IRecog.h"
#include <pthread.h>
#include "Log.h"

class IConsumer;

class RecogImpl : public IRecog
{
private:
    LOG_DECLARE;
    IConsumer & _consumer;
    const bool _testScaleMode;
    pthread_t _thread;
    mutable pthread_mutex_t _mutex;
    bool _stopRequested;
    
public:
    RecogImpl(IConsumer *, bool testScaleMode=false);
    virtual ~RecogImpl();
    virtual void start();
    bool getStopRequested() const;
    void doCycle(float freq);
};


#endif
